/*
 * List
 *
 *  Created on: Jul 5, 2012
 *      Author: s131705
 */

#ifndef LIST_
#define LIST_

#include <list>
#include <unistd.h>
#include <fcntl.h>

#include  <stdio.h>
#include  <string.h>
#include  <sys/types.h>
#include  <sys/wait.h>
using namespace std;

#include "Pipeline.h"

class List {
private:
	list<Pipeline*>* pipes;
public:
	List();
	virtual ~List();

	bool hasPipe(){return pipes->size() > 0;}
	void  addPipe( Pipeline* cp ){ pipes->push_back( cp ); };
	string toString();
	Pipeline* popPipe();
	void executePipe(Pipeline* ccp, int nextpd = 0);
	void execute();
};


#endif /* LIST_ */
